import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

class KqCoreGlobal {
  /// 组件库包名，组件库里面的图片引用需要用到这个
  static const String packageName = 'kq_flutter_core_widget';

  static GlobalKey<NavigatorState> navigatorKey = GlobalKey();

  //全局context
  static BuildContext globalContext =
      navigatorKey.currentState!.overlay!.context;

  // 全局 SharedPreferences
  static SharedPreferences? prefs;

  // 初始化SharedPreferences，需要在main.dart中初始化
  static Future init() async {
    prefs = await SharedPreferences.getInstance();
  }

  /// 接口调试模式是否开启，需要时自己修改此值
  static bool enableApiTestMode = false;

  /// 图片预览-路由, 对应页面 [ImgPreviewPage]
  static const String routerOfImagePreview = "/ImgPreview";

  /// 文件预览-路由, 对应页面 [FilePreviewPage]
  static const String routerOfFilePreview = "/FilePreview";

  /// 视频播放-路由, 对应页面 [VideoPlayPage]
  static const String routerOfVideoPlay = "/VideoPlayPage";

  /// 地址选择-路由，对应页面[AddressPick]
  static const String routerOfAddressPick = "/AddressPick";
}
